﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO
{
    /// <summary>
    /// 升级创客商品表
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class product_token_maker_dto {
        /// <summary>
        /// 活动产品Id
        /// </summary>
        public long product_activity_id { get; set; }
        /// <summary>
        /// 产品Id
        /// </summary>
        public long product_id { get; set; }

        /// <summary>
        /// 一级比例
        /// </summary>
        public decimal first_rate { get; set; }

        /// <summary>
        /// 二级比例
        /// </summary>
        public decimal second_rate { get; set; }

        /// <summary>
        /// 节点商城比例
        /// </summary>
        public decimal node_mall_rate { get; set; }

        /// <summary>
        /// 超级节点比例
        /// </summary>
        public decimal county_agent_rate { get; set; }

        /// <summary>
        /// 市分公司比例
        /// </summary>
        public decimal city_agent_rate { get; set; }

        /// <summary>
        /// 结算价
        /// </summary>
        public decimal cost_price { get; set; }

        /// <summary>
        /// 分销价
        /// </summary>
        public decimal distribution_price { get; set; }
        /// <summary>
        /// 活动商品
        /// </summary>
        [JsonIgnore]//解决缓存Json序列化循环引用bug
        public product_activity_dto product_activity { get; set; }
    }

    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class product_token_maker_dto_ex : product_token_maker_dto {
        /// <summary>
        /// 活动商品（后台使用可被序列化）
        /// </summary>
        public product_activity_dto product_activity { get; set; }

    }


        public class product_token_maker_edit_dto {
        /// <summary>
        /// 活动产品Id
        /// </summary>
        public long product_activity_id { get; set; }

        /// <summary>
        /// 一级比例
        /// </summary>
        public decimal first_rate { get; set; }

        /// <summary>
        /// 二级比例
        /// </summary>
        public decimal second_rate { get; set; }

        /// <summary>
        /// 节点商城比例
        /// </summary>
        public decimal node_mall_rate { get; set; }

        /// <summary>
        /// 超级节点比例
        /// </summary>
        public decimal county_agent_rate { get; set; }

        /// <summary>
        /// 市分公司比例
        /// </summary>
        public decimal city_agent_rate { get; set; }

        /// <summary>
        /// 销售价
        /// </summary>
        public decimal price { get; set; }
        
        /// <summary>
        /// 结算价
        /// </summary>
        public decimal cost_price { get; set; }

        /// <summary>
        /// 分销比例
        /// </summary>
        public decimal distribution_rate { get; set; }

        /// <summary>
        /// 分销价格
        /// </summary>
        public decimal? distribution_price { get; set; }

        /// <summary>
        /// 状态值（1：销售中，2：下架）
        /// </summary>
        public string status_value { get; set; }

        /// <summary>
        /// 排序（倒序：值越大越靠前）
        /// </summary>
        public int top { get; set; }
    }
}
